// pages /goods/goods.js
const { getSearch } = require("../api/index")
Page({
  data: {
    search:"",
    goodsData:[]
  },
  onLoad(options) {
    
    this.setData({
      search:options.search
    })
    getSearch({search:this.data.search}).then(res =>{
      if(!res.data.msg){
        this.setData({
        goodsData:res.data.data
      })
      }else{
        wx.showToast({
          title:res.data.msg
        })
      }
      
    })
  },
})